package test.jgroups;

import org.jgroups.Address;
import org.jgroups.stack.AddressGenerator;
import org.jgroups.util.UUID;

public class MyAddressGenerator implements AddressGenerator {

	private String name;
	private String ip;

	public MyAddressGenerator(String name, String ip) {
		this.name = name;
		this.ip = ip;
	}

	@Override
	public Address generateAddress() {
		return new MemberIdentity(UUID.randomUUID(), name, ip);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
}
